const http=require("http");
const { url } = require("inspector");
console.log(http);

const server=http.createServer((req,resp)=>{

    // console.log(req.method);//请求方法
    // console.log(req.httpVersion);//请求版本
    // console.log(req.url);//请求路径
    // console.log(req.headers);//请求头

    // let myurl=new URL(req.url);
    // //let myurl2=url.parse(req.url);
    // console.log(myurl);
   // console.log(myurl2);


    resp.setHeader("content-type","text/html;charset=utf-8")
    resp.end("<h2>Helld</h2>")
})
console.log(server)
server.listen(9000,()=>{
    console.log("监听9000端口");
    console.log("启动服务");
})
